﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$ArticleDBConnection$" formatter="bizobjlist of Article">
	
	<Sql>
		SELECT   a.id ,c.keyName
		FROM
		Articles AS a
		 LEFT OUTER JOIN ObjectTreeNodes AS t ON a.id = t.objectId
		 LEFT OUTER JOIN ObjectTreeCounts as c on c.objectId = t.objectId
		WHERE
		t.rootId = @rootId AND c.depth BETWEEN @depthFrom AND @depthTo
		ORDER BY
		c.keyName
	</Sql>
	<Param name="rootId" type="UniqueIdentifier" />
	<Param name="depthFrom" type="Int" />
	<Param name="depthTo" type="Int" />
</AdoNetDataAccess>
